//
//  XHDataBaseManager.h
//  Bees
//
//  Created by NowYouCanSee on 2018/12/26.
//  Copyright © 2018 xiaohan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Wallet.h"

static NSString * _Nullable const kCurrent_wallet_id = @"kCurrent_wallet_id";
#define CURRENT_WALLET_ID VALUEFORKEY(kCurrent_wallet_id)
#define CHANGE_CURRENT_WALLET_ID(wallet_ID) SAVELOCAL(wallet_ID,kCurrent_wallet_id)
#define CURRENT_WALLET [[XHDataBaseManager shareInstance] selectCurrentWallet]



NS_ASSUME_NONNULL_BEGIN


@interface XHDataBaseManager : NSObject

+ (XHDataBaseManager *)shareInstance;
///获取当前钱包
- (Wallet *)selectCurrentWallet;
///获取钱包
- (Wallet *)getWallet:(NSString*)wallet_uid;
///保存钱包
- (BOOL)insertWalletToDB:(Wallet *)wallet;
///删除钱包
- (BOOL)removeWallet:(NSString*)wallet_uid;
///获取所有钱包
- (NSMutableArray<Wallet *> *)selectAllLocalWallet;
///更新
- (BOOL)updateWalletToDB:(Wallet *)wallet;
///保存最近转账的人
- (void)saveHistoryWallet:(NSString *)wallet receiveName:(Receive*)receive;
///获取最近转账的人
- (NSArray *)getHistoryReceivesWallet:(NSString *)wallet;
- (void)clearHistoryReceives:(NSString*)wallet;
@end

NS_ASSUME_NONNULL_END
